<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="get" action="./login.do">

  用户名：<input type="text" name="username" value=""><br>
  密码：<input type="password" name="password" value=""><br>
  <button type="submit">登录</button>
</form>
<script type="text/javascript">
  window.onload=function (){
     var cookieStr = document.cookie;
     var strings = cookieStr.split("; ");
    for (let i = 0; i <strings.length ; i++) {
      var cookie0 = strings[i];
      var strings1 = cookie0.split("=");
      if (strings1[0]=="username"){
        document.getElementsByTagName("input")[0].value=strings1[1];
      }
      if (strings1[0]=="password"){
        document.getElementsByTagName("input")[1].value=strings1[1];
      }
    }
  }

</script>
</body>
</html>